package type.conversion;

import java.util.Scanner;

public class TypeConversion {
	public static void main(String args[]) {
		
		int iAge;
		iAge=10;
		Scanner sc=new Scanner(System.in);
		int year=sc.nextInt();
		System.out.println("年龄为"+iAge+year);
		sc.close();
		/*System.out.println("hello   world");
		System.out.println(Integer.MAX_VALUE);
		System.out.println(Long.MAX_VALUE);
		System.out.println(Short.MAX_VALUE);*/
//		byte bNumber=10;
//		short sNumber=bNumber;
//		int iNumber=sNumber;
//		long lNumber=iNumber;
//		float fNumber=1.202f;
//		double dNumber=fNumber;
	    /*	数据类型的转换 */
		/********************默认转换*******************/
		short sNumber1=10;
		short sNumber2=20;
		byte bNumber1=127;
		byte bNumber2=-128;
		int iNumber1=23647;
		int iNumber2=10;
		float fNumber1=1.01f;
		float fNumber2=1.02f;
		double dNumber1=10.11;
		double dNumber2=10.12;
		/*short类型，byte类型，char类型相加必须为int类型
		 * int类型相加可以为int类型,但是 int的大小不能超过最大范围
		 * float类型相加能用float类型
		 * float类型与double类型相加必须用double类型*/
		int sAdd=sNumber1+sNumber2;
		int bAdd=bNumber2+bNumber2;
		int iAdd=iNumber1+iNumber2;
		double dAdd=dNumber2+fNumber1;
		float fAdd=fNumber1+fNumber2;
		System.out.println(dAdd);
		System.out.println(fAdd);
		System.out.println(iAdd);
		System.out.println(bAdd);
		System.out.println(sAdd);
		
		/*System.out.println(lNumber);
		System.out.println(dNumber);*/
		/********************强制转换*******************/
	int i=1;
	double d=(double)i;
	
	System.out.println(d);
	}

}
